#include <stdio.h>
#include <string.h>
#include "data.h"

Data data_fromString(char *s){
	Data d;
	strncpy(d.s,s,DATA_MAX_LENGTH);
	d.length = strnlen(d.s,DATA_MAX_LENGTH);

return d;
}

void data_toString(Data d, char *s){
	strncpy(s,d.s,DATA_MAX_LENGTH);
}

int data_length(Data d){
	int n;
	n = d.length;
return n;
}

void print_data(Data d){
	char s[DATA_MAX_LENGTH];
	strncpy(s,d.s,DATA_MAX_LENGTH);
	printf("%s\n",s);
}
